#!/bin/bash
echo
echo
echo "                SSSSS   IIIII   FFFFFF   Y     Y	 "
echo "                SS        I     F         Y   Y 	 "
echo "                 SSS      I     FFFF       Y Y  	 "
echo "                   SS     I     F           Y   	 "
echo "                SSSSS   IIIII   F           Y   	 "
echo
echo "                  Broadband Internet Service     	 "
echo
echo
echo "Installing Sify Broadband client.  Version 1.2 "
echo
echo
echo
                                                                               
if [ `id --user` -ne 0 ]; then
  echo "You should be root to install the service"
  echo "read Readme for more info..."
  echo
  exit
fi

#killing the previously installed services
killall sifyconnect
killall sifyd
echo
echo

#to delete the old version .
rm -f /usr/bin/sifyconnect
rm -f /usr/bin/sifycommand
rm -f /etc/init.d/sifybb 

cp sifybb /etc/init.d
cp sifyconnect /usr/bin
cp sifyd /usr/bin

ln -s /etc/init.d/sifybb /etc/rc2.d/SS20sifybb
ln -s /etc/init.d/sifybb /etc/rc3.d/SS20sifybb
ln -s /etc/init.d/sifybb /etc/rc5.d/SS20sifybb
echo
echo
echo "Sify Broadband service successfully installed.."
echo "Starting service...."

if [ `ps -ef |grep sifyd|grep -v grep | wc -l ` -eq 1 ]; then
         echo "Sifyd Running...."
         else
	 /etc/init.d/sifybb start
	 echo "Sifyd Service started."
fi
echo
echo
echo
echo "Thank you for using Sify Internet service"
echo "              www.sify.com               "
echo
echo

